/* 根据剧本ID 获取 对应的角色  */

import {http} from "@/utils/http";

const getPcToken = () => {
  return localStorage.getItem("pcToken");
};
const baseProxy = import.meta.env.VITE_BASEPROXY;

/** 根据章节ID 获取对应的章节json */
export const getContentByChapterId = (id: number) => {
    return http.request<any>(
        "post",
        `${baseProxy}/acgChapter/queryByDirectoryId`,
        {
            data: {
                id
            }
        },
        {
            headers: {
                pcToken: getPcToken()
            }
        }
    );
};


/** 更新章节内容 */
export const updateContentByChapterId = (data: object) => {
    return http.request<any>(
        "post",
        `${baseProxy}/acgChapter/updateChapter`,
        {
            data: data
        },
        {
            headers: {
                pcToken: getPcToken()
            }
        }
    );
};
